// +---------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +---------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +---------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +---------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------

import request from '@/libs/request';

/**
 * @description 获取二维码列表
 * @param {Object} param params {Object} 传值参数
 */
export function getQrcodeList(params) {
  return request({
    url: '/seed/qrcodeList',
    method: 'get',
    params,
  });
}

/**
 * @description 生成二维码
 * @param {Object} data {Object} 传值参数
 * id: 种子ID
 * name: 公司名称
 * number: 生成数量
 */
export function addQrcode(data) {
  return request({
    url: '/seed/addQrcode',
    method: 'post',
    data,
  });
}

/**
 * @description 获取二维码文件下载地址
 * @param {Number} id {Number} 二维码记录id
 */
export function getCodeFile(id) {
  return request({
    url: `/seed/getCodeFile/${id}`,
    method: 'get',
  });
}

/**
 * @description 删除二维码记录
 * @param {Number} id {Number} 二维码记录id
 */
export function deleteQrcode(id) {
  return request({
    url: `/seed/delQrcode/${id}`,
    method: 'delete',
  });
}
